package com.sntk.registermanager.staff.infrastructure.db.repository;

import com.sntk.registermanager.staff.infrastructure.db.entity.DoctorInfoEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author liuyunxia
 */
@Repository
public interface DoctorInfoDBRepository extends JpaRepository<DoctorInfoEntity, Long>, JpaSpecificationExecutor<DoctorInfoEntity> {

    /**
     * 查询医生信息
     * @param doctorCode
     * @return
     */
    DoctorInfoEntity findFirstByDoctorCodeAndDelFalse(String doctorCode);

    /**
     * 根据登录名查询
     * @param uname
     * @return
     */
    DoctorInfoEntity findFirstByUnameAndDelFalse(String uname);

    List<DoctorInfoEntity> findAllByDelFalseAndDisabledFalse();
}
